import {Component, OnInit} from '@angular/core';
import {_HttpClient} from '@delon/theme';
import {ActivatedRoute} from '@angular/router';
import {environment} from '@env/environment';

@Component({
    selector: 'app-single',
    templateUrl: './single.component.html',
})
export class SingleComponent implements OnInit {

    content: string;
    url_news = '';

    constructor(
        private http: _HttpClient,
        private activityrouter: ActivatedRoute,
    ) {
    }

    ngOnInit() {
        const id = this.activityrouter.snapshot.paramMap.get('id');

        this.http.get(environment.SERVER_URL + 'News/show/' + id).subscribe(
            res => {
                this.content = res['conent'];
            }
        )
        ;
    }

}
